<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>SFML - Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html;"/>
        <meta charset="utf-8"/>
        <!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
        <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript" src="dynsections.js"></script>
        <link rel="stylesheet" type="text/css" href="search/search.css" />
        <link rel="stylesheet" type="text/css" href="searchOverrides.css" />
        <script type="text/javascript" src="search/searchdata.js"></script>
        <script type="text/javascript" src="search/search.js"></script>
        <script type="text/javascript">
        /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
          $(document).ready(function() { init_search(); });
        /* @license-end */
        </script>
    </head>
    <body>
        <div id="banner-container">
            <div id="banner">
                <span id="sfml">SFML 2.6.1</span>
            </div>
        </div>
        <div id="content">
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Clock.html">Clock</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classsf_1_1Clock-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">sf::Clock Class Reference<div class="ingroups"><a class="el" href="group__system.html">System module</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Utility class that measures the elapsed time.  
 <a href="classsf_1_1Clock.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="Clock_8hpp_source.html">SFML/System/Clock.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:abbc959c7830ca7c3a4da133cb506d3fd"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Clock.html#abbc959c7830ca7c3a4da133cb506d3fd">Clock</a> ()</td></tr>
<tr class="memdesc:abbc959c7830ca7c3a4da133cb506d3fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <br /></td></tr>
<tr class="separator:abbc959c7830ca7c3a4da133cb506d3fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe889b42a65bcd8eefc16419645d08a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Time.html">Time</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Clock.html#abe889b42a65bcd8eefc16419645d08a7">getElapsedTime</a> () const</td></tr>
<tr class="memdesc:abe889b42a65bcd8eefc16419645d08a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the elapsed time.  <br /></td></tr>
<tr class="separator:abe889b42a65bcd8eefc16419645d08a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a123e2627f2943e5ecaa1db0c7df3231b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Time.html">Time</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Clock.html#a123e2627f2943e5ecaa1db0c7df3231b">restart</a> ()</td></tr>
<tr class="memdesc:a123e2627f2943e5ecaa1db0c7df3231b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restart the clock.  <br /></td></tr>
<tr class="separator:a123e2627f2943e5ecaa1db0c7df3231b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Utility class that measures the elapsed time. </p>
<p><a class="el" href="classsf_1_1Clock.html" title="Utility class that measures the elapsed time.">sf::Clock</a> is a lightweight class for measuring time.</p>
<p>Its provides the most precise time that the underlying OS can achieve (generally microseconds or nanoseconds). It also ensures monotonicity, which means that the returned time can never go backward, even if the system time is changed.</p>
<p>Usage example: </p><div class="fragment"><div class="line"><a class="code hl_class" href="classsf_1_1Clock.html">sf::Clock</a> clock;</div>
<div class="line">...</div>
<div class="line">Time time1 = clock.<a class="code hl_function" href="classsf_1_1Clock.html#abe889b42a65bcd8eefc16419645d08a7">getElapsedTime</a>();</div>
<div class="line">...</div>
<div class="line"><a class="code hl_function" href="classsf_1_1Time.html#acba0cfbc49e3a09a22a8e079eb67a05c">Time</a> time2 = clock.<a class="code hl_function" href="classsf_1_1Clock.html#a123e2627f2943e5ecaa1db0c7df3231b">restart</a>();</div>
<div class="ttc" id="aclasssf_1_1Clock_html"><div class="ttname"><a href="classsf_1_1Clock.html">sf::Clock</a></div><div class="ttdoc">Utility class that measures the elapsed time.</div><div class="ttdef"><b>Definition</b> <a href="Clock_8hpp_source.html#l00041">Clock.hpp:42</a></div></div>
<div class="ttc" id="aclasssf_1_1Clock_html_a123e2627f2943e5ecaa1db0c7df3231b"><div class="ttname"><a href="classsf_1_1Clock.html#a123e2627f2943e5ecaa1db0c7df3231b">sf::Clock::restart</a></div><div class="ttdeci">Time restart()</div><div class="ttdoc">Restart the clock.</div></div>
<div class="ttc" id="aclasssf_1_1Clock_html_abe889b42a65bcd8eefc16419645d08a7"><div class="ttname"><a href="classsf_1_1Clock.html#abe889b42a65bcd8eefc16419645d08a7">sf::Clock::getElapsedTime</a></div><div class="ttdeci">Time getElapsedTime() const</div><div class="ttdoc">Get the elapsed time.</div></div>
<div class="ttc" id="aclasssf_1_1Time_html_acba0cfbc49e3a09a22a8e079eb67a05c"><div class="ttname"><a href="classsf_1_1Time.html#acba0cfbc49e3a09a22a8e079eb67a05c">sf::Time::Time</a></div><div class="ttdeci">Time()</div><div class="ttdoc">Default constructor.</div></div>
</div><!-- fragment --><p>The <a class="el" href="classsf_1_1Time.html" title="Represents a time value.">sf::Time</a> value returned by the clock can then be converted to a number of seconds, milliseconds or even microseconds.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Time.html" title="Represents a time value.">sf::Time</a> </dd></dl>

<p class="definition">Definition at line <a class="el" href="Clock_8hpp_source.html#l00041">41</a> of file <a class="el" href="Clock_8hpp_source.html">Clock.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="abbc959c7830ca7c3a4da133cb506d3fd" name="abbc959c7830ca7c3a4da133cb506d3fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abbc959c7830ca7c3a4da133cb506d3fd">&#9670;&#160;</a></span>Clock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sf::Clock::Clock </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Default constructor. </p>
<p>The clock starts automatically after being constructed. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="abe889b42a65bcd8eefc16419645d08a7" name="abe889b42a65bcd8eefc16419645d08a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe889b42a65bcd8eefc16419645d08a7">&#9670;&#160;</a></span>getElapsedTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Time.html">Time</a> sf::Clock::getElapsedTime </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the elapsed time. </p>
<p>This function returns the time elapsed since the last call to <a class="el" href="classsf_1_1Clock.html#a123e2627f2943e5ecaa1db0c7df3231b" title="Restart the clock.">restart()</a> (or the construction of the instance if <a class="el" href="classsf_1_1Clock.html#a123e2627f2943e5ecaa1db0c7df3231b" title="Restart the clock.">restart()</a> has not been called).</p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classsf_1_1Time.html" title="Represents a time value.">Time</a> elapsed </dd></dl>

</div>
</div>
<a id="a123e2627f2943e5ecaa1db0c7df3231b" name="a123e2627f2943e5ecaa1db0c7df3231b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a123e2627f2943e5ecaa1db0c7df3231b">&#9670;&#160;</a></span>restart()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Time.html">Time</a> sf::Clock::restart </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Restart the clock. </p>
<p>This function puts the time counter back to zero. It also returns the time elapsed since the clock was started.</p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classsf_1_1Time.html" title="Represents a time value.">Time</a> elapsed </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Clock_8hpp_source.html">Clock.hpp</a></li>
</ul>
</div><!-- contents -->
        </div>
        <div id="footer-container">
            <div id="footer">
                SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
                Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
                Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
            </div>
        </div>
    </body>
</html>
